<{extend name="public/base"}>
<{block name="foot_source"}>
<script type="text/javascript" src="/static/webuploader/webuploader.js"></script>
<link rel="stylesheet" type="text/css" href="/static/webuploader/webuploader.css">
<style type="text/css">
    #product-list{
        width:100%;
    }
    #product-list td {
        border:1px solid silver;
        height:35px;
        text-align:center;
    }
    .sum{
        color:red;
    }
</style>
<{/block}>
<{block name="content"}>
<!-- left column -->
<div class="col-md-12">
    <!-- general form elements -->
    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title"><{$title}></h3>
        </div>
        <!-- /.box-header -->
        <!-- form start -->
        <form role="form" method="post" action="<{:url('admin/order_accountant/update')}>" id="form" >
            <div class="box-body">

                <div class="form-group">
                    <label for="product-list">订单产品</label>
                </div>

                <div class="form-group">
                    <div class="">
                        <table id="product-list">
                            <tr>
                                <td>产品名称</td><td>产品编号</td><td>市场价格</td><td>团购价格</td><td>佣金</td><td>数量</td><td>实际支付价格</td><td>实际产生佣金</td>
                            </tr>
                            <?php foreach($order_product as $key => $val ){  ?>
                            <tr>
                                <td><{$val.product_id}></td><td><{$val.number}></td><td><{$val.market_price}></td><td><{$val.sell_price}></td><td><{$val.salary}></td><td><{$val.number}></td><td><{$val.total_price}></td><td><{$val.total_salary}></td>
                            </tr>
                            <?php } ?>
                        </table>
                    </div>
                    <div class="form-control">
                        总价：<span id="total_price" class="sum"><{$model->total_price}></span> 总佣金：<span id="total_salary" class="sum"><{$model->total_salary}></span>
                    </div>
                </div>

                <div>
                    <label>风格详情图列表</label>
                    <div id="image-list-container">
                        <?php foreach($model->picture_list as $key => $val ){ ?>
                        <div style="width:100px;float:left;text-align:center;margin:10px;">
                            <img src="<?php echo $val; ?>"  style="width:100px;height:100px;margin-bottom:5px;" data-src="<{$val}>"/>
                        </div>
                        <?php } ?>
                    </div><!---详情列表--->
                    <div class="clearfix"></div>
                    <div id="image_list">
                    </div>
                </div>


                <div class="form-group">
                    <label>地址</label>
                    <div><{$model->address}></div>
                </div>

                <div class="form-group">
                    <label >邮编</label>
                    <div><{$model->zcode}></div>
                </div>

                <div class="form-group">
                    <label >手机人联系方式</label>
                    <div><{$model->cellphone}></div>
                </div>
                <div>
                    <label >当前订单状态</label>
                    <div style="color:red;"><?php echo get_order_state()[$model->state]; ?></div>
                </div>
                <div class="form-group">
                    <label>修改订单状态</label>
                    <select name="state" class="form-control">
                        <?php $order_state_vector = get_order_state_accountant_map(); $order_state_dict = get_order_state(); ?>

                        <?php foreach($order_state_vector[$model->state] as $key => $val ) { ?>
                        <option value="<{$val}>" ><{$order_state_dict[$val]}></option>
                        <?php } ?>
                    </select>
                </div>
                <div class="form-group">
                    <label>操作说明</label>
                    <textarea placeholder="操作说明,提供给相关人员查看" class="form-control" name="message"></textarea>
                </div>
                <input type="hidden" value="<{$model->id}>" name="id" />
            </div>
            <!-- /.box-body -->
            <div class="box-footer">
                <button class="btn btn-primary">提交</button>
                <a href="javascript:window.history.go(-1);" class="btn btn-default" >返回</a>
            </div>
        </form>
    </div>
    <!-- /.box -->
</div>


<{/block}>
<{block name="foot_script"}>



<script type="text/javascript">


    var imageShow = document.createElement('img');
    imageShow.style.display = 'none';
    document.body.appendChild(imageShow);
    $("#image-list-container").delegate('img','mouseover',function(){
        imageShow.src = $(this).attr('src');
        imageShow.style.cssText = "width:"+imageShow.width+"px;height:"+imageShow.height+"px;display:block;position:fixed;left:50%;top:50%;margin-left:-"+(imageShow.width)/2 + "px;margin-top:-"+(imageShow.height)/2+"px;";
    });
    $("#image-list-container").delegate('img','mouseleave',function(){
        imageShow.style.display = 'none';
    });
    $("#image-list-container").delegate('.del','click',function(){
        $(this).parent().parent().remove();
    });
    $("#image-list-container").delegate('.move-to-right','click',function(){
        var $dom = $(this).parent().parent();
        var $next = $dom.next();
        $next.after($dom);
    });


</script>
<{/block}>

